package com.goodfox.web.generic.function.entity;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

import com.goodfox.web.generic.authority.entity.Resources;
import com.goodfox.web.generic.provide.annotation.DbEntity;
import com.goodfox.web.generic.provide.annotation.DbField;

@DbEntity(comment="系统功能",table="DSYS_FUNCTION")
public class Function implements Serializable,Comparable<Function>{

	@DbField(comment="实例化UID",meaning=false)
	private static final long serialVersionUID = 1633515566850504921L;
	
	@DbField(comment="功能ID",column="FUN_ID",pk=true,export=false,javaType="String",dataType="VARCHAR2",required=true,maxLength=50)
	private String funId;

	@DbField(comment="上级功能ID",column="FUN_ID_PARENT",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funIdParent;

	@DbField(comment="功能名称",column="FUN_NAME",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funName;

	@DbField(comment="功能代码",column="FUN_CODE",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funCode;

	@DbField(comment="功能层级",column="FUN_GRADE",javaType="Long",dataType="NUMBER",maxLength=4)
	private Long funGrade;

	@DbField(comment="功能显示顺序",column="FUN_SORT",javaType="Long",dataType="NUMBER",maxLength=4)
	private Long funSort;

	@DbField(comment="功能适用范围",column="FUN_SCOPE",javaType="String",dataType="VARCHAR2",maxLength=2)
	private String funScope;

	@DbField(comment="功能备注",column="FUN_REMARK",javaType="String",dataType="VARCHAR2",maxLength=200)
	private String funRemark;

	@DbField(comment="功能状态",column="FUN_STATE",javaType="String",dataType="VARCHAR2",maxLength=2)
	private String funState;

	@DbField(comment="功能访问URL",column="FUN_USE_URL",javaType="String",dataType="VARCHAR2",maxLength=100)
	private String funUseUrl;

	@DbField(comment="功能使用方式",column="FUN_USE",javaType="String",dataType="VARCHAR2",maxLength=2)
	private String funUse;

	@DbField(comment="功能值",column="FUN_VALUE",javaType="String",dataType="VARCHAR2",maxLength=100)
	private String funValue;

	@DbField(comment="功能英语名称",column="FUN_NAME_US",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funNameUs;

	@DbField(comment="上级功能",column="FUN_NAME_PARENT",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funNameParent;

	@DbField(comment="子功能数量",column="SUB_COUNT",export=false,direct=false)
	private Long subCount;

	@DbField(comment="资源数量",column="RSE_COUNT",export=false,direct=false)
	private Long rseCount;

	@DbField(comment="角色数量",column="ROLE_COUNT",export=false,direct=false)
	private Long roleCount;

	@DbField(comment="适用范围",column="FUN_SCOPE_NAME",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funScopeName;

	@DbField(comment="使用方式",column="FUN_USE_NAME",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funUseName;

	@DbField(comment="状态",column="FUN_STATE_NAME",javaType="String",dataType="VARCHAR2",maxLength=50)
	private String funStateName;

	@DbField(comment="上级功能层级",column="FUN_GRADE_PARENT",export=false,javaType="Long",dataType="NUMBER",maxLength=4)
	private Long funGradeParent;

	@DbField(comment="资源列表",export=false,direct=false)
	private List<Resources> funRseList;

	@DbField(comment="子功能列表",export=false,direct=false)
	private Set<Function> realSubFunSet;

	@DbField(comment="子功能数量",export=false,direct=false)
	private Long realSubCount;

	@DbField(comment="是否选中",export=false,direct=false)
	private Long isChoise=0L;
	
	public String getFunId() {
		return funId;
	}
	public void setFunId(String funId) {
		this.funId = funId;
	}
	public String getFunIdParent() {
		return funIdParent;
	}
	public void setFunIdParent(String funIdParent) {
		this.funIdParent = funIdParent;
	}
	public String getFunName() {
		return funName;
	}
	public void setFunName(String funName) {
		this.funName = funName;
	}
	public String getFunCode() {
		return funCode;
	}
	public void setFunCode(String funCode) {
		this.funCode = funCode;
	}
	public Long getFunGrade() {
		return funGrade;
	}
	public void setFunGrade(Long funGrade) {
		this.funGrade = funGrade;
	}
	public Long getFunSort() {
		return funSort;
	}
	public void setFunSort(Long funSort) {
		this.funSort = funSort;
	}
	public String getFunScope() {
		return funScope;
	}
	public void setFunScope(String funScope) {
		this.funScope = funScope;
	}
	public String getFunRemark() {
		return funRemark;
	}
	public void setFunRemark(String funRemark) {
		this.funRemark = funRemark;
	}
	public String getFunState() {
		return funState;
	}
	public void setFunState(String funState) {
		this.funState = funState;
	}
	public String getFunUseUrl() {
		return funUseUrl;
	}
	public void setFunUseUrl(String funUseUrl) {
		this.funUseUrl = funUseUrl;
	}
	public String getFunUse() {
		return funUse;
	}
	public void setFunUse(String funUse) {
		this.funUse = funUse;
	}
	public String getFunValue() {
		return funValue;
	}
	public void setFunValue(String funValue) {
		this.funValue = funValue;
	}
	public String getFunNameUs() {
		return funNameUs;
	}
	public void setFunNameUs(String funNameUs) {
		this.funNameUs = funNameUs;
	}
	public String getFunNameParent() {
		return funNameParent;
	}
	public void setFunNameParent(String funNameParent) {
		this.funNameParent = funNameParent;
	}
	public Long getSubCount() {
		return subCount;
	}
	public void setSubCount(Long subCount) {
		this.subCount = subCount;
	}
	public Long getRseCount() {
		return rseCount;
	}
	public void setRseCount(Long rseCount) {
		this.rseCount = rseCount;
	}
	public Long getRoleCount() {
		return roleCount;
	}
	public void setRoleCount(Long roleCount) {
		this.roleCount = roleCount;
	}
	public String getFunScopeName() {
		return funScopeName;
	}
	public void setFunScopeName(String funScopeName) {
		this.funScopeName = funScopeName;
	}
	public String getFunUseName() {
		return funUseName;
	}
	public void setFunUseName(String funUseName) {
		this.funUseName = funUseName;
	}
	public String getFunStateName() {
		return funStateName;
	}
	public void setFunStateName(String funStateName) {
		this.funStateName = funStateName;
	}
	public Long getFunGradeParent() {
		return funGradeParent;
	}
	public void setFunGradeParent(Long funGradeParent) {
		this.funGradeParent = funGradeParent;
	}
	public List<Resources> getFunRseList() {
		return funRseList;
	}
	public void setFunRseList(List<Resources> funRseList) {
		this.funRseList = funRseList;
	}
	public Set<Function> getRealSubFunSet() {
		return realSubFunSet;
	}
	public void setRealSubFunSet(Set<Function> realSubFunSet) {
		this.realSubFunSet = realSubFunSet;
	}
	
	public Long getRealSubCount() {
		return realSubCount;
	}
	public void setRealSubCount(Long realSubCount) {
		this.realSubCount = realSubCount;
	}
	
	public Long getIsChoise() {
		return isChoise;
	}
	public void setIsChoise(Long isChoise) {
		this.isChoise = isChoise;
	}
	/**
	 * 覆盖比较方法，排序用
	 * @param resources
	 * @return
	 */
	@Override
	public int compareTo(Function function) {
		return Integer.parseInt(String.valueOf((getFunSort()-function.getFunSort())));
	}
	
	
}
